//商家信息容器
//通过connect 把state 和 dispatch 通过props 属性直接垂直映射到storeInfo 组件上
import {connect} from 'react-redux'
//引入ui组件
import StoreInfo from '../../components/home/storeInfo'
//引入action中的文件
import {getStoreLists} from '../../action/index'
//1、映射state
const mapStateToProps =(state)=>{
    return{
        //获取商家列表数据
        storeList:state.storeInfoReducers
    }
}
//2、映射dispatch
const mapDispatchToProps =(dispatch)=>{
    return{
        getStoreList(){
            dispatch(getStoreLists())
        }
    }
}
//高阶组件：在一个函数里面传入一个组件并返回一个组件那么就成为高阶组件
let StoreInfoContain = connect(mapStateToProps,mapDispatchToProps)(StoreInfo)
//暴露出去
export default StoreInfoContain
